package com.itheima.reggie.service;

import com.itheima.reggie.entity.AddressBook;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AddressBookService {

    /**
     * 新增收货地址
     * @param addressBook
     * @return
     */

    Boolean addAddressBook(AddressBook addressBook);

    /**
     * 显示用户地址列表
     * @param userId
     * @return
     */
    List<AddressBook> findAllAddress(Long userId);

    /**
     * 根据id修改地址
     * @param
     * @return
     */

    Boolean updateAddress(AddressBook addressBook);

    /**
     * 设置默认地址
     * @param addressBook
     * @return
     */
    Boolean setDefaultAddress(AddressBook addressBook);


    /**
     * 数据回显：回显地址
     * @param id
     * @return
     */

    AddressBook findAddressById(Long id);


    /**
     * 删除地址
     * @param id
     * @return
     */
    Integer deleteAddressBook(Long id);

    //得到默认地址
    AddressBook getDefaultAddress(Long currentId);

}
